package com.juku2024.juku.db.dao;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;

import com.juku2024.juku.db.entity.NoticeDetailEntity;

import java.util.List;


@Dao
public interface NoticeDao {

    @Query("SELECT * FROM notice WHERE version=:version")
    NoticeDetailEntity query(long version);

    @Query("SELECT * FROM notice")
    List<NoticeDetailEntity> queryAll();

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(NoticeDetailEntity noticeDetailEntity);


    @Query("DELETE FROM notice")
    void deleteAll();
}
